package com.ye.springboot.controller;

import org.springframework.web.bind.annotation.*;

@RestController
public class TestController {


    @RequestMapping(value = "/tests", method = RequestMethod.GET)
    public String hello() {
        System.out.println("request is coming");
        return "hello spring boot";
    }

    @RequestMapping(value = "/tests/{id}", method = RequestMethod.DELETE)
    public String delete(@PathVariable Integer id) {

        return "delete id: " + id;
    }

    @RequestMapping(value = "/tests", method = RequestMethod.POST)
    @ResponseBody
    public String add(@ResponseBody Test test) {
        return "test";
    }
}
